package com.keon.jianbao.ui.fragment;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

import com.keon.jianbao.AppManager;
import com.keon.jianbao.R;
import com.keon.jianbao.base.BaseActivity;
import com.keon.jianbao.base.BaseFragment;
import com.keon.jianbao.enu.CheckType;
import com.keon.jianbao.enu.ListType;
import com.keon.jianbao.enu.WebType;
import com.keon.jianbao.ui.activity.BespeakAppraisalActivity;
import com.keon.jianbao.ui.activity.ListActivity;
import com.keon.jianbao.ui.activity.RuleActivity;
import com.keon.jianbao.ui.activity.TermActivity;
import com.keon.jianbao.ui.activity.WebActivity;

import butterknife.Bind;

/**
 * Created by keon on 2015/9/2.
 */
public class JianBaoFragment extends BaseFragment {

    @Bind(R.id.jianbao_online)
    ImageView ivOnline;
    @Bind(R.id.jianbao_rule)
    ImageView ivRule;
    @Bind(R.id.jianbao_door)
    ImageView ivDoor;
    @Bind(R.id.jianbao_light)
    ImageView ivLight;

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_jiangbao;
    }

    @Override
    public void initView(View view) {
        ivOnline.setOnClickListener(this);
        ivRule.setOnClickListener(this);
        ivDoor.setOnClickListener(this);
        ivLight.setOnClickListener(this);
    }

    @Override
    public void initData() {

    }

    @Override
    public void onClick(View view) {
        int id = view.getId();
        Bundle bundle = new Bundle();
        BaseActivity ba = (BaseActivity) getActivity();
        switch (id) {
            case R.id.jianbao_online:
                bundle.putInt("type", ListType.EXPERTGRIDLIST.getId());
                ba.jump(ListActivity.class, bundle);
                break;
            case R.id.jianbao_rule:
                ba.jump(RuleActivity.class);

//                bundle.putInt("type", WebType.TERM.getId());
//                ba.jump(WebActivity.class, bundle);
                break;
            case R.id.jianbao_door:
                bundle.putInt("type", CheckType.DOOR.getType());
                ba.jump(BespeakAppraisalActivity.class, bundle);
//                ba.jump(TermActivity.class);
                break;
            case R.id.jianbao_light:
                bundle.putInt("type", CheckType.LIGHT.getType());
                ba.jump(BespeakAppraisalActivity.class, bundle);
                break;
        }
    }
}
